package com.example.sql.manager.utils;

import java.util.Random;

public class IDUtils {

    public static Long genRandomId() {
        //取当前时间的长整形值包含毫秒
        long millis = System.currentTimeMillis();
        //加上随机数
        Random random = new Random();
        int suffix = random.nextInt(99);
        //位数不足前面补0
        return Long.valueOf(millis + String.format("%02d", suffix));
    }
}
